#-------------------------------------------------------------------------------
#Here, we list all directories in the Cgal/src folder
#-------------------------------------------------------------------------------
SET(CGL_DIRS
  CglAllDifferent
	CglClique
	CglDuplicateRow
	CglFlowCover
	CglGomory
	CglKnapsackCover
	CglLandP
	CglLiftAndProject
	CglMixedIntegerRounding
	CglMixedIntegerRounding2
	CglOddHole
	CglPreProcess
	CglProbing
	CglRedSplit
	CglResidualCapacity
	CglSimpleRounding
	CglTwomir
)

#-------------------------------------------------------------------------------
#Here, we build the files that will be used to create the library
#-------------------------------------------------------------------------------
SET(CGL_SRCS "") #an empty variable to hold the files
FOREACH(B_DIR ${CGL_DIRS})
  #grab all the files in this folder
  FILE(GLOB T_SRCS
       ${CBC_ROOT_DIR}/Cgl/src/${B_DIR}/*.cpp)
  SET(CGL_SRCS ${CGL_SRCS} ${T_SRCS})
ENDFOREACH(B_DIR ${CGL_DIRS})

#-------------------------------------------------------------------------------
#Finally, add all files in the root directory
#-------------------------------------------------------------------------------
FILE(GLOB CGL_SRCS1  ${CBC_ROOT_DIR}/Cgl/src/*.cpp)
SET(CGL_SRCS ${CGL_SRCS} ${CGL_SRCS1})

#-------------------------------------------------------------------------------
#and build the library
#-------------------------------------------------------------------------------
ADD_LIBRARY(COIN_Cgl ${CGL_SRCS})
INSTALL(
  TARGETS
    COIN_Cgl
  ARCHIVE DESTINATION 
    lib
)